<?php 
	class AccessRule extends CAccessRule {
	    public $redirect; // just add this property
	    public $ajaxResponse;
	    
		public function isUserAllowed($user,$controller,$action,$ip,$verb)
		{
			if($this->isActionMatched($action)){
					if($this->isUserMatched($user)
					&& $this->isRoleMatched($user)
					&& $this->isIpMatched($ip)
					&& $this->isVerbMatched($verb)
					&& $this->isControllerMatched($controller)
					&& $this->isExpressionMatched($user)){
						return $this->allow ? 1 : -1;
					}else{
						return $this->allow ? -1 : 1;
					}
			}else{
				return 0;
			}
		}
		
		protected function isActionMatched($action)
		{
			$ret = empty($this->actions) || in_array(strtolower($action->getId()),$this->actions);
			return $ret;
		}
	}
